package com.ecoolex.union.pay.retailer.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.util.ArrayList;
import java.util.Arrays;
import org.springframework.lang.NonNull;

/**
 *
 *   银联优惠券调用记录<br>
 *<br>
 * 数据表： union_pay_coupon_call_record
 *
 */
@Description({"银联优惠券调用记录"})
public class UnionPayCouponCallRecordWithBLOBs extends UnionPayCouponCallRecord {
    /**
     *
     *   原始请求    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.OrginRequest
     */
    @Description({"原始请求", "数据长度: 65535"})
    private String orginRequest;

    /**
     *
     *   加密后的请求    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedRequest
     */
    @Description({"加密后的请求", "数据长度: 65535"})
    private String encryptedRequest;

    /**
     *
     *   加密的响应    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedResponse
     */
    @Description({"加密的响应", "数据长度: 65535"})
    private String encryptedResponse;

    /**
     *
     *   解密后的响应    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.DecryptedResponse
     */
    @Description({"解密后的响应", "数据长度: 65535"})
    private String decryptedResponse;

    /**
     * 获取参数<br><br>
     *
     *   原始请求    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.OrginRequest
     */
    public String getOrginRequest() {
        return orginRequest;
    }

    /**
     * 设置参数<br><br>
     *
     *   原始请求<br>
     *<br>
     * 字段名： union_pay_coupon_call_record.OrginRequest
     */
    public void setOrginRequest(String orginRequest) {
        this.orginRequest = orginRequest == null ? null : orginRequest.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   加密后的请求    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedRequest
     */
    public String getEncryptedRequest() {
        return encryptedRequest;
    }

    /**
     * 设置参数<br><br>
     *
     *   加密后的请求<br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedRequest
     */
    public void setEncryptedRequest(String encryptedRequest) {
        this.encryptedRequest = encryptedRequest == null ? null : encryptedRequest.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   加密的响应    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedResponse
     */
    public String getEncryptedResponse() {
        return encryptedResponse;
    }

    /**
     * 设置参数<br><br>
     *
     *   加密的响应<br>
     *<br>
     * 字段名： union_pay_coupon_call_record.EncryptedResponse
     */
    public void setEncryptedResponse(String encryptedResponse) {
        this.encryptedResponse = encryptedResponse == null ? null : encryptedResponse.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   解密后的响应    <br>
     *<br>
     * 字段名： union_pay_coupon_call_record.DecryptedResponse
     */
    public String getDecryptedResponse() {
        return decryptedResponse;
    }

    /**
     * 设置参数<br><br>
     *
     *   解密后的响应<br>
     *<br>
     * 字段名： union_pay_coupon_call_record.DecryptedResponse
     */
    public void setDecryptedResponse(String decryptedResponse) {
        this.decryptedResponse = decryptedResponse == null ? null : decryptedResponse.trim();
    }

    public enum Column {
        id("Id", "id", "BIGINT", false),
        couponCode("CouponCode", "couponCode", "VARCHAR", false),
        operationType("OperationType", "operationType", "VARCHAR", false),
        orderNo("OrderNo", "orderNo", "VARCHAR", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false),
        isSuccess("isSuccess", "isSuccess", "BIT", false),
        orginRequest("OrginRequest", "orginRequest", "LONGVARCHAR", false),
        encryptedRequest("EncryptedRequest", "encryptedRequest", "LONGVARCHAR", false),
        encryptedResponse("EncryptedResponse", "encryptedResponse", "LONGVARCHAR", false),
        decryptedResponse("DecryptedResponse", "decryptedResponse", "LONGVARCHAR", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}